/*
* Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
*/

#ifndef DVPP_SQE_UPDATE_COMM_H
#define DVPP_SQE_UPDATE_COMM_H

#include <linux/types.h>
#include "dvpp_cmdlist.h"

typedef struct {
    pid_t pid;
    uint32_t devid;
    uint32_t pf_id;
    uint32_t vf_id;
} dvpp_comm_para;

typedef struct {
    uint64_t cmdbuf_uva;
    uint64_t cmdbuf_kva;
    uint64_t cmdbuf_size;
    uint64_t args_uva;
    uint64_t args_kva;
    uint64_t args_size;
    uint8_t is_use_mem_pool;
} dvpp_save_para;

int32_t dvpp_comm_drv_ready(dvpp_sqe_args *sqe_args, uint64_t tlv_stru_addr, uint64_t* cmdbuf_size_used);
uint64_t alloc_args_mem(uint32_t pool_id, uint64_t size, dvpp_sqe_args *sqe_args);
int32_t copy_args_from_user(dvpp_save_para *save_para, dvpp_sqe_args *sqe_args);
uint64_t get_alloc_size(dvpp_sqe_args *sqe_args, uint64_t dma_info_size);

#endif // #ifndef DVPP_SQE_UPDATE_COMM_H